<template>
  <a-card :bordered="false">

    <!-- 查询区域 -->
    <div class="table-page-search-wrapper" style="margin-top:20px;">
      <a-form layout="inline">
        <a-row :gutter="24">
          <!-- 操作按钮区域 -->
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <div class="table-operator">
              <!-- 切换模式的按钮 -->
              <a style="font-size:16px" v-if="islist" @click="handleChangeType">
                <a-icon type="appstore"/>
                图片模式
              </a>
              <a style="font-size:16px" @click="handleChangeType" v-else>
                <a-icon type="database"/>
                列表模式
              </a>
            </div>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="资源名称">
              <a-input placeholder="请输入关键字" v-model="mytext"></a-input>
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchResult" icon="search">查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>

      <!-- 开始是列表模式 -->
      <mymaplist v-if="islist" ref="maplist" :ismanager='ismanager'></mymaplist>
      <!-- 图片模式 -->
      <mymapphoto v-else ref="mapphoto" :ismanager='ismanager'></mymapphoto>

  </a-card>
</template>


<script>
import '@/assets/less/TableExpand.less'
import Axios from 'axios'
import mymaplist from '@/components/mycomponents/mymaplist';
import mymapphoto from  '@/components/mycomponents/mymapphoto';

let allSource = []

export default {
  name: 'MyTenantMapList',
  components: {
    mymaplist,
    mymapphoto,
  },
  
  data(){
    return{
      islist: false,
      value: 'all',
      allSource,
      mytext:'',
      ismanager:false
    }
  },

  created() {
  },
  
  
  methods: {
    initDictConfig() {
    },
    handleChangeType() {
      this.islist = !this.islist
    },
    searchResult() {
      if(this.islist){
        this.$refs.maplist.searchMap(this.mytext)
      }else{
        this.$refs.mapphoto.searchMyMap(this.mytext)
      }
    },
    searchReset(){
        this.mytext = '',
        this.searchResult()
    }
  }
}
</script>
<style scoped>

@import '~@assets/less/common.less';
</style>